﻿using System.ComponentModel.DataAnnotations;
using Epam.PeopleInterfaces;

namespace Epam.PeopleModel
{
    public class ViewPeopleEntity:IViewPeopleEntity
    {
        
        [Required]
        [RegularExpression("[0-9a-zA-Z -]{1,50}", ErrorMessage = "Invalid name")]
        public string Name { get; private set; }

        [DisplayFormat(DataFormatString = "{0:F4}")]
        public double Factor { get; private set; }

        public int Age { get; private set; }

        public ViewPeopleEntity(string name, double factor,int age)
        {
            Name = name;
            Factor = factor;
            Age = age;
        }

        public ViewPeopleEntity()
        {
            Name = string.Empty;
            Factor = 0;
            Age = 0;
        }
    }
}
